<template>
    <fieldset>
        <legend>列表</legend>
        <ul>
           <li v-for="item in products" :key="item._id">
            <router-link :to="`/DetailsPage2/${item.productId}`">{{item.productName}}</router-link>
           </li>
        </ul>
    </fieldset>
</template>
<script>
    export default{
        data(){
            return{
                products:[]
            }
        },
        mounted(){
            fetch("http://chst.vip:1234/api/getmoneyctrl")
            .then(body=>body.json())
            .then(res=>{
                console.log(res)
                this.products=res.result;
            })
        }
    }
</script>